<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('系统通知公告列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row">
    <div class="col-sm-12 search-collapse">
      <form id="dept-form">
        <div class="select-list">
          <ul>
            <li>
              标题：<input type="text" name="ntcTitle"/>
            </li>
            <li>
              内容：<input type="text" name="ntcContent"/>
            </li>
            <li>
              类别：<select name="sortCode"
                      onchange="dropChgSendTextOnly(this,'sortName');">
                <option value="">请选择</option>
                <option value="11">普通</option>
                <option value="12">重要</option>
                <option value="21">紧急</option>
              </select>
            </li>
            <li>
              来源单位：<input type="text" name="fromDept"/>
            </li>
            <li>
              发布者：<input type="text" name="issueUser"/>
            </li>
            <li>
              <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                      class="fa fa-search"></i>&nbsp;搜索</a>
              <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                      class="fa fa-refresh"></i>&nbsp;重置</a>
            </li>
          </ul>
        </div>
      </form>
    </div>
    <div class="col-sm-12 select-table table-striped">
      <table id="bootstrap-table"></table>
    </div>
  </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
  var prefix = ctx + "system/mInterior/cfNotice"

  $(function () {
    var options = {
      sortName:"IssueTime",
      sortOrder:"desc",
      uniqueId: "myPkVal",
      url: prefix + "/ntcListJson",
      detailUrl: prefix + "/ntcDetail/{id}",
      modalName: "系统通知公告",
      columns: [
        {field:'myPkVal',title:'myPkVal',visible:false},
        {field:'NtcTitle',title:'通知标题',align:'center',halign:'center',
            formatter:function (value, row, index){
                return "<span style='cursor: pointer;' title='"+value+"'>"+value+"</span>";
            },
          cellStyle: cellEllipsis
        },
        {field:'SortName',title:'类别',align:'center',sortable:true,},
        {field:'FromDept',title:'来源单位',align:'center'},
        {field:'IssueUser',title:'发布者',align:'center'},
        {field:'fbTime',title:'时间',align:'center'},
        {
          title: '操作',
          align: 'center',
          formatter: function (value, row, index) {
            var actions = [];
            actions.push('<a class="btn btn-success btn-outline btn-xs" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.myPkVal + '\')"><i class="fa"></i>查看</a> ');
            return actions.join('');
          }
        }
      ]
    };
    $.table.init(options);
  });
  
</script>
</body>
</html>